<?php

namespace app\admin\controller;

use think\facade\App;

class Url extends Base {

    /**
     * @desc 我的链接
     */
    public function index() {
        $params = [];
        $params['startDate'] = input('startDate', '', 'trim');
        $params['endDate']   = input('endDate', '', 'trim');
        $params['userName']  = input('userName', '', 'trim');
        $params['keyword']   = input('keyword', '', 'trim');
        $params['link']      = input('link', '', 'trim');
        $params['pageSize']  = input('pageSize', 10);

        $logic = model('Url', 'logic');
        $data = $logic->index($params);

        $this->assign($data);
        return view();
    }

    /**
     * @desc 链接日志
     * @return \think\response\View
     */
    public function log() {
        $params = [];
        $params['startDate'] = input('startDate', '', 'trim');
        $params['endDate']   = input('endDate', '', 'trim');
        $params['keyword']   = input('keyword', '', 'trim');
        $params['shortUrl']   = input('shortUrl', '', 'trim');
        $params['pageSize']  = input('pageSize', 10);

        $logic = model('Url', 'logic');
        $data = $logic->log($params);

        $this->assign($data);
        return view();
    }
}
